<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use phpDocumentor\Reflection\Types\True_;

/**
 * App\Models\User
 *
 * @property int $id
 * @property string $nickname 昵称
 * @property int|null $gender 性别
 * @property string|null $avatar 头像
 * @property string|null $phone 手机号码
 * @property string|null $address 地址
 * @property \Illuminate\Support\Carbon|null $created_at 创建时间
 * @property \Illuminate\Support\Carbon|null $updated_at 更新时间
 * @method static \Illuminate\Database\Eloquent\Builder|User newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|User query()
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereAvatar($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereGender($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereNickname($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User wherePhone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property string|null $open_id open_id
 * @property string|null $api_token token值
 * @property int|null $expire_time token过期时间
 * @method static \Illuminate\Database\Eloquent\Builder|User whereApiToken($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereExpireTime($value)
 * @method static \Illuminate\Database\Eloquent\Builder|User whereOpenId($value)
 */
class User extends Model
{
    //
    protected $table = 'user';
    public $incrementing = true;
    public $timestamps = true;
    protected $fillable = [
        'nickname','gender','avatar','phone','address','api_token','open_id'
    ];





    public function setCreatedAtAttribute($value)
    {
        $this->attributes['created_at'] = strtotime($value);
    }
    public function setUpdatedAtAttribute($value)
    {
        $this->attributes['updated_at'] = strtotime($value);
    }
    public function getAvatarAttribute($value)
    {
        return $value;
    }

}
